# arc operations.
set.arc(x, from, to, check.cycles = TRUE, debug = FALSE)
drop.arc(x, from, to, debug = FALSE)
reverse.arc(x, from, to, check.cycles = TRUE, debug = FALSE)# edge (i.e. undirected arc) operations
set.edge(x, from, to, check.cycles = TRUE, debug = FALSE)
drop.edge(x, from, to, debug = FALSE)
bn
.TRUE
the graph is
tested for acyclicity; otherwise the graph is returned anyway.TRUE
a lot of debugging output
is printed; otherwise the function is completely silent.x
.set.arc
function operates in the following way:
from
andto
,
the arcfrom
$\rightarrow$to
is added.from
andto
, its direction is set tofrom
$\rightarrow$to
.to
$\rightarrow$from
is present, it is reversed.from
$\rightarrow$to
is present, no action is taken. The drop.arc
function operates in the following way:
from
andto
,
no action is taken.from
andto
, it is dropped regardless of its
direction. The reverse.arc
function operates in the following way:
from
andto
,
it returns an error.from
andto
, it returns an error.to
$\rightarrow$from
is present, it is reversed.from
$\rightarrow$to
is present, it is reversed. The set.edge
function operates in the following way:
from
andto
,
the undirected arcfrom
-to
is added.from
andto
, no action is taken.from
$\rightarrow$to
or the arcto
$\rightarrow$from
are present, they are replaced with the
undirected arcfrom
-to
. The drop.edge
function operates in the following way:
from
andto
, no action is taken.from
andto
, it is removed.from
andto
, no action is taken.data(learning.test)
res = gs(learning.test)
## use debug = TRUE to get more information.
set.arc(res, "A", "B")
drop.arc(res, "A", "B")
drop.edge(res, "A", "B")
reverse.arc(res, "A", "D")
Run the code above in your browser using DataLab